package org.grails.simplesolr;

import org.apache.lucene.index.FieldInvertState;
import org.apache.lucene.search.DefaultSimilarity;

@SuppressWarnings("serial")
public class NoLengthNormSimilarity extends DefaultSimilarity {

	@Override
	public float computeNorm(String arg0, FieldInvertState arg1) {
		System.out.println("AUO computeNorm " + arg0);
		int length = arg1.getLength();
		arg1.setLength(1);
		float norm = super.computeNorm(arg0, arg1);
		arg1.setLength(length);
		return norm;
	}
}
